/* Plugin Name: 360 Gewinnbox Description: Verwaltung der Gewinnspiele für 360 und Familienpass. Version: 1.0 Author: Ewald Natter Author URI: http://www.freelenz.at */ require("gewinnabholung.php"); require("log.php"); require("notifications.php"); if($_GET["export"] == "teilnehmer"){ $csv = fopen("../wp-content/plugins/360-gewinnbox/export/export-teilnehmer.csv", "w+"); $fieldnames = array( "DATUM / UHRZEIT", "VORNAME", "NACHNAME", "ADRESSE", "PLZ", "ORT", "HANDY", "EMAIL", "NEWSLETTER", "DEVICE", "ANMELDUNG", "GEWONNEN", ); fputcsv($csv, $fieldnames, ";"); $teilnehmer = $wpdb->get_results(" SELECT * FROM wpneu_teilnehmer WHERE gewinnspiel_id=".$_GET["post"]." ORDER BY winner DESC, timestamp DESC "); foreach($teilnehmer as $result): $fields["timestamp"] = $result->timestamp; $fields["vorname"] = $result->vorname; $fields["nachname"] = $result->nachname; $fields["adresse"] = $result->adresse; $fields["plz"] = $result->plz; $fields["ort"] = $result->ort; $fields["handy"] = $result->handy; $fields["email"] = $result->email; $fields["newsletter"] = ($result->newsletter ==1) ? "Ja" : "Nein"; $fields["device"] = $result->device; $fields["anmeldung"] = $result->anmeldung; $fields["gewonnen"] = ($result->winner == 1) ? "Ja" : "Nein"; /* echo '
';
print_r($fields);
echo '';
*/
fputcsv($csv, $fields, ";");
endforeach;
fclose($csv);
$file_url = '../wp-content/plugins/360-gewinnbox/export/export-teilnehmer.csv';
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url); // do the double-download-dance (dirty but worky)
exit();
}
if($_GET["delete"] == "teilnehmer"){
$wpdb->query("DELETE FROM wpneu_teilnehmer WHERE id=".$_GET["id"]);
}
/*
Plugin Name: App Server Schaltzentrale
Description: Ermöglicht diverse Tests und Aktionen auf dem AppServer.
Version: 1.0
Author: Ewald Natter
Author URI: http://www.freelenz.at
*/
add_action('admin_menu', 'plugin_appserver_init');
function date_output($date){
return substr($date, 6,2).".".substr($date, 4,2).".".substr($date,0,4);
}
function date_reverse($date){
return substr($date, 6,4).substr($date, 3,2).substr($date,0,2);
}
function plugin_appserver_init() {
add_options_page('AppServer', 'AppServer', 1, basename(__FILE__), 'appserver_options_page');
}
function appserver_options_page() {
?>
| ID | Passwort | Funktionen | Vorname | Nachname | PLZ | Ort | Geburtsdatum | v:date | Kartentyp | Telefon | 360-to-go am Handy | Zuletzt geändert | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| echo $card->mid ?> | echo $card->appKey ?> |
|
echo $card->vorname ?> | echo $card->nachname ?> | echo $card->plz ?> | echo $card->ort ?> | echo date_output($card->gebdat) ?> | echo date_output($card->vdate) ?> | $kartentyp = $card->kartentyp; $kartentyp = str_replace("cla", "Classic", $kartentyp); $kartentyp = str_replace("leh", "Lehrling", $kartentyp); $kartentyp = str_replace("lan", "Landjugend", $kartentyp); $kartentyp = str_replace("sec", "Security", $kartentyp); echo $kartentyp; ?> | echo $card->email ?> | echo $card->handy ?> |
if($card->karteAktiv and $card->deviceid): ?>
|
if($card->tstamp != "0000-00-00 00:00:00"){ echo date("d.m.Y H:i", strtotime($card->tstamp)); } ?> |
$status = ($card->karteAktiv == 1) ? "aktiv" : "inaktiv"; ?>
|